feat: Implement Proxy Groups for Better Organization#1018
Draft
Wikid82 wants to merge 21 commits into
Draft
Conversation
…cy versions in package-lock.json
Contributor
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Contributor
✅ Supply Chain Verification Results✅ PASSED 📦 SBOM Summary
🔍 Vulnerability Scan
📎 Artifacts
Generated by Supply Chain Verification workflow • View Details |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Add ProxyGroup model, service, and CRUD API handlers with full test coverage for host grouping functionality. - Add ProxyGroup model with UUID, name, description, color fields - Add ProxyGroupID FK and ProxyGroup preload to ProxyHost - Add ProxyGroupService with Create/List/GetByUUID/Update/Delete - Add ProxyGroupHandler with GET/POST/PUT/DELETE routes - Extend ProxyHostHandler to resolve proxy_group_id by UUID or uint - AutoMigrate ProxyGroup before ProxyHost in routes.go - Add 22 tests across service, handler, and preload integration Closes #254
Add ProxyGroups API client with TanStack Query hooks Add ProxyGroupBadge and ProxyGroupForm components Integrate proxy group selection into ProxyHosts page Add locale strings (de, en, es, fr, zh) for proxy group feature Add frontend unit tests for API client, components, and hooks Add E2E Playwright spec for proxy group management workflows Update ProxyHosts tests to reflect proxy group column addition Update vitest config for new component test coverage
Add proxy group column and assignment UI to ProxyHosts table Update proxyHosts API client to include group_id field Add proxy group locale keys for all supported languages (de, en, es, fr, zh) Update ProxyHosts tests to cover proxy group column and filtering Extend vitest config for expanded proxy hosts test coverage
…lity and enhance UI translations
…onitors feat(crowdsec): implement logic to remove whitelist file when no entries exist test(crowdsec): add tests for whitelist YAML file removal when entries are empty fix(uptime): enhance indexing for UptimeHeartbeat fields
…nced drag-and-drop functionality
- Hosts can be dragged individually or in bulk (multi-select) into any group section or the ungrouped section, updating their group membership server-side - Backend exposes a single PUT /proxy-hosts/bulk-update-group endpoint that updates all dragged hosts in one request and calls Caddy ApplyConfig once instead of N times, keeping Caddy config consistent and avoiding thundering herd - Optimistic UI update rolls back on network failure so the list never shows stale state after a failed drag - Screen reader users receive live announcements on drag start, drag over, drop, and cancel via @dnd-kit accessibility.announcements, satisfying WCAG 2.2 §4.1.3 - Toast notifications correctly show success (with i18next pluralization count matching dragged host count) or error (including full-failure case that was previously silent) - Group name helper exposed in ProxyHosts for accessibility announcements alongside the existing host name helper - All five locale files updated with DnD announcement and status strings - New DnD hook, drop zone, drag handle, and bulk API encapsulated in separate files to keep ProxyHosts.tsx focused on layout and wiring - 6 unit tests for BulkUpdateGroup handler; 5 unit tests for useProxyGroupDnD hook covering happy path, no-op same-group, rollback, partial success, and multi-select drag - Backend patch coverage 90.5%, frontend patch coverage 95.6%, overall 92%
…eration tests - Five vi.mock() calls added for useSecurityHeaders and useProxyGroups in the bulk-operation test files were missing trailing semicolons, causing CodeQL to flag them under the automatic-semicolon-insertion rule - Every other vi.mock() statement in those files has an explicit semicolon, so the linter correctly flagged the inconsistency - No test logic was changed; the fix is purely syntactic to satisfy static analysis
- The react-i18next mock was returning raw keys verbatim, causing tests that look for human-readable strings like "Create Group" to fail against the rendered key "proxyGroups.createGroup" - Expanded the mock to return proper translated strings for all keys used by the component, including interpolated values for the color preset aria-label - No component logic changed; this is a test-only correction
Adding the Group column in the proxy groups feature pushed total column widths to 112%, causing the right side of each row to overflow and get clipped. Redistributed width from Name, Domain, Forward, SSL, and Features columns to bring the total back to 100%.
…ps feature - Add trailing semicolons to vi.mock() blocks in five proxy host test files to eliminate CodeQL js/automatic-semicolon-insertion alerts that would have flagged CI code scanning - Replace broken i18n mock in ProxyGroupForm tests with a full translation map so all 11 tests pass; they were previously failing in CI due to missing colorPreset translation keys - Correct proxy hosts table column widths that totalled 112%, causing the group column to overflow in the host list view; columns now sum to exactly 100% - Add targeted tests for proxy group rendering paths in ProxyHosts that were uncovered by the feature addition, lifting frontend patch coverage above threshold - Add tests for useProxyGroupDnD drag-and-drop hook covering the boundary and reorder paths introduced by the proxy groups feature - Install @dnd-kit/core as a direct dependency required by the group rendering tests in the jsdom environment All local patch coverage thresholds pass: Overall 90.2% (≥90%), Backend 90.2% (≥85%), Frontend 90.4% (≥85%). Coverage artifacts are fresh and verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds proxy group management to Charon, allowing proxy hosts to be organized into named groups for easier administration.
Backend
models/proxy_group.go— NewProxyGroupGORM model with UUID primary key, name, description, and host associationsmodels/proxy_host.go— AddedGroupID(nullable FK) andGroupassociation fieldsservices/proxy_group_service.go— CRUD service: create, list, get, update, delete with validationservices/proxyhost_service.go— ExtendedGetProxyHoststo support optional group filtering viagroup_idquery paramapi/handlers/proxy_group_handler.go— REST handler for/api/v1/proxy-groups(CRUD + host listing per group)api/routes/routes.go— Registered proxy group routes under/api/v1/proxy-groupsFrontend
api/proxyGroups.ts— TanStack Query API client for proxy group CRUDapi/proxyHosts.ts— Addedgroup_idfield and group filter supportcomponents/ProxyGroupBadge.tsx— Badge component displaying assigned group namecomponents/ProxyGroupForm.tsx— Form component for group assignment with comboboxhooks/useProxyGroups.ts— TanStack Query hooks:useProxyGroups,useCreateProxyGroup,useUpdateProxyGroup,useDeleteProxyGrouppages/ProxyHosts.tsx— Proxy group column added to table; inline group assignment UIproxyGroup.*translation keys added forde,en,es,fr,zhTests
proxy_group_handler_test.go,proxy_group_service_test.go,proxyhost_service_group_test.goproxyGroups.test.ts,ProxyGroupBadge.test.tsx,ProxyGroupForm.test.tsxProxyHoststest suite (12 files) to account for new group columntests/proxy-groups.spec.tsQuality Gates
vitest.config.tscoverage thresholds updated to reflect expanded test surface